! function(h) {
    var g = h.HTMLCanvasElement && h.HTMLCanvasElement.prototype,
        l = h.Blob && function() {
            try {
                return Boolean(new Blob)
            } catch (b) {
                return !1
            }
        }(),
        k = l && h.Uint8Array && function() {
            try {
                return 100 === new Blob([new Uint8Array(100)]).size
            } catch (b) {
                return !1
            }
        }(),
        j = h.BlobBuilder || h.WebKitBlobBuilder || h.MozBlobBuilder || h.MSBlobBuilder,
        i = (l || j) && h.atob && h.ArrayBuffer && h.Uint8Array && function(d) {
            var c, p, o, n, m, e;
            for (c = d.split(",")[0].indexOf("base64") >= 0 ? atob(d.split(",")[1]) : decodeURIComponent(d.split(",")[1]), p = new ArrayBuffer(c.length), o = new Uint8Array(p), n = 0; n < c.length; n += 1) {
                o[n] = c.charCodeAt(n)
            }
            return m = d.split(",")[0].split(":")[1].split(";")[0], l ? new Blob([k ? o : p], {
                type: m
            }) : (e = new j, e.append(p), e.getBlob(m))
        };
    h.HTMLCanvasElement && !g.toBlob && (g.mozGetAsFile ? g.toBlob = function(b, f, e) {
        e && g.toDataURL && i ? b(i(this.toDataURL(f, e))) : b(this.mozGetAsFile("blob", f))
    } : g.toDataURL && i && (g.toBlob = function(e, d, f) {
        e(i(this.toDataURL(d, f)))
    })), "function" == typeof define && define.amd ? define(function() {
        return i
    }) : h.dataURLtoBlob = i
}(this);
